home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
TP062892.ARJ
/
06-28-92.TPC
Wrap
Text File
|
1992-06-28
|
48KB
|
1,624 lines
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 01-01-00 00:00:00
From
To
Subject
--- WM v2.01/92-0100
* Origin: A.C.E. of Spades (615)383-4381 The B.A.N. board (1:116/33)
* Tossed by SFToss v1.00b on 92/04/09 12:01:00
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-19-92 00:08:00
From Norbert Igl
To Peter Beeftink
Subject Find Error ?
Hello Peter,
≡ File Edit Search Run Compile Deb
╔═[■]══════════ ┌──────────────────────┐ ═
║ │ Find... │
║ │ Replace... │
║ │ Search again │
║ │ Go to line number... │
║ │ Find procedure... │
║ │ Find error... │ <<<<<<<<< Here it is (:-))
║ └──────────────────────┘
Bye from Germany, Norbert
--- GoldED 2.40
* Origin: May the source be with you... (2:241/5300.3)
* Tossed by SFToss v1.00b on 92/06/20 12:16:48
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-21-92 00:56:15
From
To
Subject
--- D'Bridge 1.30/001666
* Origin: Telcom Central (1:135/23)
* Tossed by SFToss v1.00b on 92/06/21 07:11:30
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-20-92 10:34:00
From Norbert Igl
To Erik Giberti
Subject Little Problem
Hello Erik,
EG> I am having a little difficulty with loops though, mabey you could help me.
EG> This is how I have it set up...
EG> A variable is given a Char definition, and the value is equal to
EG> 'Y','y','N' or 'n'
EG> then in the following a problem results...
EG> if Letter = 'Y' or 'y' then
EG> Screen1
EG> if Letter = 'N' or 'N' then
EG> Screen2
EG> else
EG> Screen3
EG> This didnt seem to work... So I took out the or statements in the first two
If ..
then
else .... works fine for simple choices..
Try Case.. of for multiple choice :
Case Letter of
'Y','y' : Screen1;
'N','n' : Screen2;
else Screen3;
end;
Gruss aus Bonn, Norbert
--- GoldED 2.40
* Origin: where's the beef ? ... at (2:241/5300.3)
* Tossed by SFToss v1.00b on 92/06/21 07:11:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-21-92 23:37:07
From Mark Ouellet
To James Cook
Subject Re: Turbo 6
On 09 Jun 92, you, James Cook, of 1:387/307.0 wrote...
-=>> Quoting Mark Ouellet to Shawn Osborn <=-
MO>> Any ways here are the 6.0 features:
MO>> The IDE:
MO>> Written using Turbo Vision which supports
MO>> keyboard, mouse, multiple overlapping windows,
MO>> scroll bars, dialog boxes, pull down menus and more.
JC> Mark,
JC> A little known fact is that the IDE for Turbo Pascal 6.0 is written
JC> in C.
James,
I have serious doubts about this one, that PART of
it were written in C no problems but since Turbo Vision for
C came out much later than TP 6.0 I would suspect the actual
Turbo Vision code was in TP.
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:35
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-21-92 23:40:10
From Mark Ouellet
To Vince Laurent
Subject Re: SBlaster...
On 10 Jun 92, you, Vince Laurent, of 1:382/10.0 wrote...
|=>> Thanks, I might take a look but I prefer Freq'ing as
|=>> logging on as a human caller often makes the difference
|=>> between spending a few bucks for a file and a large LD bill.
VL> {$Change of subject....}
VL>
VL> The BBS I call to get mail has been having problems with getting the
VL> mail regularly...so I have missed a few days here and there. Did you
VL> ever get the WHOLE adlib/sb program that was posted? Did you ever find
VL> any more code anywhere?
Vince,
Yes I did, in fact I tried writing you to know
whether you got it all or not. I beleive it was reposted in
3 messages on the last attempt, it was also posted in other
echoes as I remember. Let me know if you want it.
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:35
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-21-92 23:43:30
From Mark Ouellet
To David Masaki
Subject RE: Clearing keyboard buffer
On 09 Jun 92, you, David Masaki, of 1:345/27.0 wrote...
MO>> Actually I prefer his...Though the "if keypressed
MO>> then" is not needed his version has the added bonus of not
MO>> requireing any temporary variables like this:
MO>>
MO>> while keypressed do if readkey=#0 then;
MO>>
MO>> The "if readkey=" part satisfies TP that the result of the
MO>> function is being used and so this will work both on TP 6.0
MO>> and 5.5 while using:
MO>>
MO>> while keypressed do readkey;
DM> Yeah, I didn't realize the purpose of the comparison of 0 to readkey
DM> when I first read his message. But is it really essential to save a
DM> variable in this case?
Woah, I allmost missed that one, I just deleted a
whole paragraph having realised you wrote "SAVE" and not
"HAVE" in that last sentence ;-)
NO it is not essential to save a variable in this
case but most programmers will try to limit the number of
dummy variables they use. In this case it might even make
more sens to use your other proposed solution and simply
create a procedure called ClearKeyboard. In fact it makes
sens both in saving code and variables and increases
readability of the code.
DM> I took a computer science class last year, and
DM> when I used a while instead of a for to save a variable, I was told to
DM> use the for instead because it was easier to read. I was passed a
DM> variable in a function and was using it as a counter, and since it was
DM> already initialized, I'd either do something like for i := i downto 0 or
DM> for j := downto 0 (either initializing a variable to itself, or using
DM> another variable). I didn't think using a while was hard to understand,
DM> but in this case with the keyboard buffering it is a bit more complex
DM> than I think it needs to be. I guess it's just one of those few quirks
DM> in Pascal that's neat to take advantage of. C has a lot of these and
DM> consequently has been given a reputation of being cryptic--but only if
DM> the programmer makes it so.
DM> ------------------------------------
David,
Actually each repetitive-construct has it's place.
The reason your teacher wanted you to use a "for" instead of
a "while" is probably that your repetition had a defined
number of cycles.
In general if you know beforehand how many times to
loop you use a "for" if the number of cycles is undefined
you use a "while" or a "repeat-until".
You loop FOR a predetermined number of times
OR
You loop WHILE a certain condition is true
OR
You REPEAT a loop UNTIL a certain condition is true.
Of course, if the language doesn't have a "FOR"
construct a "while" or any equivalent method can be used. In
fact my teacher once forced us to produce the same program
using each construct so that we could notice the difference
between each of them such as the difference between "while"
and "repeat-until", the condition being false to begin with,
the "while" will never execute while the "repeat-until" will
ALLWAYS execute at least once no matter what the initial
state.
As a last note, modifying a "for"'s variable is
usually seen as a bad practice since some languages may
introduce side-effects when such a practice is used.
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-22-92 00:05:04
From Mark Ouellet
To Joy Mukherjee
Subject Re: Compressing Binary Sorted Trees
On 10 Jun 92, you, Joy Mukherjee, of 1:387/255.625 wrote...
JM> Have you seen Algorithms by Sedgewick? It has algorithms only, but I
JM> used it to create the Red-Black trees quite easily and they are slightly
JM> better than AVL trees (supposedly). I have typed up some source if you
JM> are interested in it. Its in VAX pascal, but you should have no problem
JM> converting it.
Joy,
I am in deed interrested in this code, in fact if
you could also supply me with an ISBN number for the Sedgewick
book it would be most helpfull.
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-22-92 00:08:56
From Mark Ouellet
To Rolf Thomassen
Subject Re: Clearing keyboard buffer
On 11 Jun 92, you, Rolf Thomassen, of 2:234/11.0 wrote...
RT> Hej Mark!
RT>
RT> Onsdag 03. Juni 1992 skriver Mark Ouellet til David Masaki:
RT>
RT>
MO>> while keypressed do if readkey=#0 then;
MO>> The "if readkey=" part satisfies TP that the result of the
MO>> function is being used and so this will work both on TP 6.0
MO>> and 5.5 while using:
MO>> while keypressed do readkey;
MO>> allthough a bit shorter will require the {$X+} compiler
MO>> directive which is available in TP 6.0> only.
RT> Why not just use this:
RT>
RT> PROCEDURE ClearKeyBuffer;
RT> BEGIN
RT> IF KeyPressed THEN
RT> WHILE ReadKey <> #0 DO ;
RT> END;
RT>
RT> And you dont have to use the {$X+} directive
Rolf,
If you try it you will see why ;-)
And hit a few FUNCTION KEYS while trying it.
In fact here is an example program:
=-==-=-=-==-=-=-=-=-=-=-=- cut here -=-=-=--=-==-=-=-=-
program TestReadKey;
uses crt;
var
OurKey : char;
DosOutput : text;
procedure ClearKeyboard;
begin
if keypressed then
while readkey <> #0 do;
end;
procedure MyClearKeyboard;
begin
while keypressed do if readkey = #0 then;
end;
begin
assign(DosOutput,''); {So output can be sent to file}
rewrite(DosOutput); {with redirection '>' since CRT}
{disables redirection we have to}
{reassign a text variable to the}
{standard output}
writeln('Hit a few function-keys');
writeln(DosOutput,'Hit a few function-keys');
delay(15000); {15 second delay, Enough time to}
{fill the buffer with a few keystrokes}
ClearKeyboard;
while keypressed do begin
OurKey := readkey;
writeln(DosOutput, '''',OurKey,'''',Ord(OurKey));
end;
writeln(DosOutput, '===============================================');
writeln(DosOutPut,'Hit a few function-keys');
writeln('Hit a few function-keys');
delay(15000); {Again 15 second delay}
MyClearKeyboard;
while keypressed do begin
OurKey := readkey;
writeln(DosOutput, '''',OurKey,'''',Ord(OurKey));
end;
writeln(DosOutput, '===============================================');
end.
=-=-=-=--=-=-=-=-=-=-=-=-=-- cut here -=-=-=-=--==-=--==-=-
And here are the results hitting F1,3,5,7,9 then F2,4,6,8,10
in both cases.
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hit a few function-keys
';'59
'
--- QM v1.00
* Origin: (1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-23-92 19:57:29
From Mark Ouellet
To Gavin Campbell
Subject Re: Keyboard Buffer
On 09 Jun 92, you, Gavin Campbell, of 1:250/801.0 wrote...
GC> Does anyone know how to stick keys into the keyboard buffer so that
GC> the next readkey command will pick it up. Help please!!!
Gavin,
Look at Int 16 function 5 I think ??? And DOS will
actually do it for you, much safer than playing around with
the buffer by your own.
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-23-92 20:27:59
From Mark Ouellet
To BRIAN PAPE
Subject RE: CLEARING KEYBOARD BUF
On 11 Jun 92, you, BRIAN PAPE, of 618.0 wrote...
->> GG> While keypressed do while readkey = #0 do;
BP> The problem with that is if READKEY = #0 (as in an extended keystroke),
BP> it will sit in the second while loop doing nothing- forever.
BP>
BP> It should probably be written:
BP> While keypressed do if readkey=#0 then;
BP>
BP> which will work
Exactly, probably even better to make it a procedure:
procedure ClearKeyboard;
begin
while keypressed do if readkey=#0 then;
end;
BP> --- Mosaic v1.00
BP> + Origin: "Universal Worlds" -= The Worlds Of Astronomy & Science =-
BP> (618) 931-8226
BRIAN,
BTW what is your adress ??? it seems to be missing
from your origin line.
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-23-92 20:33:20
From Mark Ouellet
To BRIAN PAPE
Subject Re: XXX
On 11 Jun 92, you, BRIAN PAPE, of 618.0 wrote...
BP> ...
BP> var
BP> ch:char;
BP> a:array[1..10] of char;
BP> i:byte;
BP> begin
BP> i:=1;
BP> while (i<10) and (ch<>#13) do
^^^^^^^^^^^^^^^^^^^^^^^^^^ will allways input 9
caracters.
BP> begin
BP> a[i]:=readkey;
BP> write('x');
BP> inc(i);
BP> end;
BP> end.
BP> * Origin: "Universal Worlds" -= The Worlds Of Astronomy & Science =-
BP> (618) 931-8226
BTW BRIAN,
what is your adress??, it seems to be missing from
your origin line.
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-23-92 20:57:55
From Mark Ouellet
To Gerald Gutierrez
Subject Re: Find Error ?
On 14 Jun 92, you, Gerald Gutierrez, of 1:153/715.5 wrote...
GG> Lately I've been having a little trouble with some source that I'm
GG> working on, and I thought that I might be able to find some use for the
GG> "Find Error" option in the pulldowns of TP6's IDE, however I don't seem
GG> to be able to get this working. The reply I always get after entering an
GG> address is simply "Error Address Not Found". Ideas ?
Gerald,
force a BUILD of ALL units and be sure to activate
ALL debugging options. Also make sure the code does not
contain compiler directives that might override the
settings.
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-23-92 21:38:01
From Mark Ouellet
To David G. Edwards
Subject Re: Find Error ?
On 16 Jun 92, you, David G. Edwards, of 1:370/60.5 wrote...
DG> BTW, is anyone using Borland's newly-acquired version control system?
David,
could you give me more details on this ???
Best regards,
Mark Ouellet.
--- ME2
* Origin: Governements, Proof of Peter's principle (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/06/25 11:40:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-24-92 21:29:00
From Norbert Igl
To BRIAN PAPE
Subject SAVE GRAPHICS SCREEN
Hello BRIAN,
BP> { no error checking }
and no syntax checking, too... (:-(
BP> var
BP> f:file;
BP> begin
BP> assign(f,'FOO.DAT');
BP> rewrite(f);
must read : Rewrite(F,1); ...
BP> blockwrite(f,ptr($B800),80*25*2);
'cause this will write 80*25*2 * 128 Bytes !!!
BP> end.
..btw, ever thought about CLOSING a file ?
BP> { this would save a text screen including attributes }
no, it won't! Gives you a 0-byte file....
BP> To save a graphics screen containing more than 64k of data you would
BP> need to use multiple blockwrites because the max it can write at a time
BP> is 64k
...maybe there must be some techniques to change the graphic-pages
before writeing to a file, while in g-modes using more than 64k ?
Remeber : (E)VGA segment for graphmode is $A000:0..$A000:FFFF.
Norbert
--- GoldED 2.40
* Origin: where's the beef ? ... at (2:241/5300.3)
* Tossed by SFToss v1.00b on 92/06/26 20:20:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-24-92 21:15:00
From Norbert Igl
To John Clements
Subject UNIX-style TimeStamp
Hello John,
JC> Does anyone know how to process a UNIX-style TimeStamp, of type LongInt?!
JC> I have a need for it, but don't know the right processes for it...
Unit UnixDate;
(***************************************************************************)
(* UNIX DATE Version 1.00 *)
(* This unit provides access to UNIX date related functions and procedures *)
(* A UNIX date is the number of seconds from January 1, 1970. This unit *)
(* may be freely used. If you modify the source code, please do not *)
(* distribute your enhancements. *)
(* (C) 1991 by Brian Stark. *)
(* A programming release from Desert Fox Productions *)
(* FidoNet 1:289/3.8 + Columbia, MO - USA *)
(* Hatched via Pascal24 FileNetwork Germany by M.Mucko (2:242/94) *)
(* ----------------------------------------------------------------------- *)
(* bstark@pro-aasgard.cts.com *)
(* brian.stark@p8.f3.n289.z1.fidonet.org *)
(***************************************************************************)
INTERFACE
Uses
DOS;
Function GetTimeZone : ShortInt;
{ Returns the value from the enviroment variable "TZ". If not found, UTC is
assumed, and a value of zero is returned}
Function IsLeapYear(Source : Word) : Boolean;
{Determines if the year is a leap year or not}
Function Norm2Unix(Y, M, D, H, Min, S : Word) : LongInt;
{Convert a normal date to its UNIX date. If environment variable "TZ" is
defined, then the input parameters are assumed to be in **LOCAL TIME**}
Procedure Unix2Norm(Date : LongInt; Var Y, M, D, H, Min, S : Word);
{Convert a UNIX date to its normal date counterpart. If the environment
variable "TZ" is defined, then the output will be in **LOCAL TIME**}
Const
DaysPerMonth :
Array[1..12] of ShortInt = (031,028,031,030,031,030,031,031,030,031,030,031)
DaysPerYear :
Array[1..12] of Integer = (031,059,090,120,151,181,212,243,273,304,334,365)
DaysPerLeapYear :
Array[1..12] of Integer = (031,060,091,121,152,182,213,244,274,305,335,366)
SecsPerYear : LongInt = 31536000;
SecsPerLeapYear : LongInt = 31622400;
SecsPerDay : LongInt = 86400;
SecsPerHour : Integer = 3600;
SecsPerMinute : ShortInt = 60;
IMPLEMENTATION Function GetTimeZone : ShortInt;
{}
Var
Environment : String;
Index : Integer;
Begin
GetTimeZone := 0; {Assume UTC}
Environment := GetEnv('TZ'); {Grab TZ string}
For Index := 1 To Length(Environment) Do
Environment[Index] := Upcase(Environment[Index]);
If Environment = 'EST05' Then GetTimeZone := -05; {USA EASTERN}
If Environment = 'EST05EDT' Then GetTimeZone := -06;
If Environment = 'CST06' Then GetTimeZone := -06; {USA CENTRAL}
If Environment = 'CST06CDT' Then GetTimeZone := -07;
If Environment = 'MST07' Then GetTimeZone := -07; {USA MOUNTAIN}
If Environment = 'MST07MDT' Then GetTimeZone := -08;
If Environment = 'PST08' Then GetTimeZone := -08;
If Environment = 'PST08PDT' Then GetTimeZone := -09;
If Environment = 'YST09' Then GetTimeZone := -09;
If Environment = 'AST10' Then GetTimeZone := -10;
If Environment = 'BST11' Then GetTimeZone := -11;
If Environment = 'CET-1' Then GetTimeZone := 01;
If Environment = 'CET-01' Then GetTimeZone := 01;
If Environment = 'EST-10' Then GetTimeZone := 10;
If Environment = 'WST-8' Then GetTimeZone := 08; {Perth, Western
Austrailia}
If Environment = 'WST-08' Then GetTimeZone := 08;
End; Function IsLeapYear(Source : Word) : Boolean;
{}
Begin
If (Source Mod 4 = 0) Then
IsLeapYear := True
Else
IsLeapYear := False;
End; Function Norm2Unix(Y,M,D,H,Min,S : Word) : LongInt;
{}
Var
UnixDate : LongInt;
Index : Word;
Begin
UnixDate := 0; {initialize}
Inc(UnixDate,S); {add seconds}
Inc(UnixDate,(SecsPerMinute * Min)); {add minutes}
Inc(UnixDate,(SecsPerHour * H)); {add hours}
(*************************************************************************)
(* If UTC = 0, and local time is -06 hours of UTC, then *)
(* UTC := UTC - (-06 * SecsPerHour) *)
(* Remember that a negative # minus a negative # yields a positive value *)
(*************************************************************************)
UnixDate := UnixDate - (GetTimeZone * SecsPerHour); {UTC offset}
If D > 1 Then {has one day already passed?}
Inc(UnixDate,(SecsPerDay * (D-1)));
If IsLeapYear(Y) Then
DaysPerMonth[02] := 29
Else
DaysPerMonth[02] := 28; {Check for Feb. 29th}
Index := 1;
If M > 1 Then For Index := 1 To (M-1) Do {has one month already passed?}
Inc(UnixDate,(DaysPerMonth[Index] * SecsPerDay));
While Y > 1970 Do
Begin
If IsLeapYear((Y-1)) Then
Inc(UnixDate,SecsPerLeapYear)
Else
Inc(UnixDate,SecsPerYear);
Dec(Y,1);
End;
Norm2Unix := UnixDate;
End; Procedure Unix2Norm(Date : LongInt; Var Y, M, D, H, Min, S : Word);
{}
Var
LocalDate : LongInt; Done : Boolean; X : ShortInt; TotDays : Integer;
Begin
Y := 1970; M := 1; D := 1; H := 0; Min := 0; S := 0;
LocalDate := Date + (GetTimeZone * SecsPerHour); {Local time date}
(*************************************************************************)
(* Sweep out the years... *)
(*************************************************************************)
Done := False;
While Not Done Do
Begin
If LocalDate >= SecsPerYear Then
Begin
Inc(Y,1);
Dec(LocalDate,SecsPerYear);
End
Else
Done := True;
If (IsLeapYear(Y+1)) And (LocalDate >= SecsPerLeapYear) And
(Not Done) Then
Begin
Inc(Y,1);
Dec(LocalDate,SecsPerLeapYear);
End;
End;
(*************************************************************************)
M := 1; D := 1;
Done := False;
TotDays := LocalDate Div SecsPerDay;
If IsLeapYear(Y) Then
Begin
DaysPerMonth[02] := 29;
X := 1;
Repeat
If (TotDays <= DaysPerLeapYear[x]) Then
Begin
M := X;
Done := True;
Dec(LocalDate,(TotDays * SecsPerDay));
D := DaysPerMonth[M]-(DaysPerLeapYear[M]-TotDays) + 1;
End
Else
Done := False;
Inc(X);
Until (Done) or (X > 12);
End
Else
Begin
DaysPerMonth[02] := 28;
X := 1;
Repeat
If (TotDays <= DaysPerYear[x]) Then
Begin
M := X;
Done := True;
Dec(LocalDate,(TotDays * SecsPerDay));
D := DaysPerMonth[M]-(DaysPerYear[M]-TotDays) + 1;
End
Else
Done := False;
Inc(X);
Until Done = True or (X > 12);
End;
H := LocalDate Div SecsPerHour;
Dec(LocalDate,(H * SecsPerHour));
Min := LocalDate Div SecsPerMinute;
Dec(LocalDate,(Min * SecsPerMinute));
S := LocalDate;
End;
END.
Gruss aus Bonn, Norbert
--- GoldED 2.40
* Origin: May the source be with you... (2:241/5300.3)
* Tossed by SFToss v1.00b on 92/06/26 20:20:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-25-92 21:24:00
From Norbert Igl
To Jud Mccranie
Subject Dialing the phone
JM> In TP, how can I make it dial a number on the modem? I've never written
JM> anything that goes to the COM port before. What I want to do is have
JM> the user pick a customer, hit a key, and the modem dials their phone #
JM> so the user can then pick up the phone and talk to them.
".. do it my way" - F. Sinatra =(;-)
(* no error checking... *)
function Dial( Nb:string; ComPort:Byte; ):Char;
Const DialCmd = 'ATDT';
OnHook = 'ATH';
Var Modem : Text;
UserKey,
ComNb : Char;
begin
if (ComPort < 1) or ( ComPort > 4) then exit;
ComNb := CHAR( Byte('0') + ComPort );
Assign( Modem, 'COM'+ComNb );
ReWrite( Modem );
Repeat
Writeln( Modem , OnHook );
Delay( 500 );
Writeln( Modem , DialCmd, Nb);
UserKey := ReadKey;
Until UserKey <> ' '; { Hit [SPACE] to redial ! }
Writeln( Modem , OnHook ); { switch the line to the handset ...}
Close ( Modem );
Dial := UserKey; { see what key the user pressed... }
end;
HTH, Norbert
--- GoldED 2.40
* Origin: May the source be with you... (2:241/5300.3)
* Tossed by SFToss v1.00b on 92/06/26 20:20:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-25-92 22:09:34
From Dj Murdoch
To Chris Kaminski
Subject Re: Turbo Pascal vs. C
CK> C (and C++) are excellent power languages. They offer a closer working
CK> with the internal components of your computer. It is also a rather
CK> difficult language to learn. Once you learn in though, you can do some
CK> rather amazing things with it. It is a very good graphics language and
CK> most authoring systems have been written in C. It also uses assembly, and
CK> can be even more powerful if used in conjunction.
In fact, the assembler built in to TP 6 is better than what you got in C compile
s last time I looked. (Current releases may be better, I'm not familiar with
them.) They generally required an external assembler to assemble the code,
which meant it couldn't make references to any symbols known to the compiler.
The TP 6 compiler has a built in assembler which knows all the symbols that
the compiler knows.
I'd also challenge the idea that C is closer to the internal components of
your computer than Pascal is. I'd say the opposite is true, if you are talking
about the 8086 family of computers and Turbo Pascal. Take a look at the ugly
way segmented pointers are handled in C compared to TP, for instance; look
at the TP Mem and Port arrays for another example.
I've read that the 8086 was designed under the assumption that Pascal would
be the most commonly used high level language for it; that's why it has 4
segment registers for stack, code, data, and heap, just like Pascal. C was
designed for a flat architecture, and segments don't fit it well.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss v1.00b on 92/06/27 11:01:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-26-92 22:22:06
From Trevor Carlsen
To Jud Mccranie
Subject Re: Turbo 6
JM> But you want to silence the 5.5 users.
Jud, I want to see this debate of TP5.x V TP6 discontinued COMPLETELY.
My reason? It is pointless as TP5.x cannot be purchased and those who do
not have TP have no option other than TP6. The debate is also achieving nothing
positive for the echo and is purely subjective. If you have a beef about
TP6 take it up with Borland directly. It is also obvious that the majority
of echo users want the thread to end.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-26-92 23:23:00
From Trevor Carlsen
To BRIAN PAPE
Subject RE: CLEARING KEYBOARD BUF
GG> While keypressed do while readkey = #0 do;
BP> The problem with that is if READKEY = #0 (as in an extended
BP> extended keystroke), it will sit in the second while loop
BP> doing nothing- forever.
No...look closely. :-)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 15:17:39
From Trevor Carlsen
To Jeffrey Miyares
Subject Command line
MC> Look up ParamCount and ParamStr ()...
JM> Can anyone give someone else help, or does everyone have
JM> to tell them to look it up? Come one, take a few seconds
JM> and help someone. What's the purpose of this echo if the
JM> only way to learn is by NOT using the echo, but LOOKING UP
JM> everything? I hope I never have to ask a question about
JM> Pascal on here. I'll just look it up before I do and save
JM> some people the time that it takes them to write 'look it
JM> up' to me.
One of the rules of this echo is that it is not to be used as a replacement
for a manual. Obviously this is meant to deter those who think that owning
stolen software is OK.
In the above message, Mike assumes that the user has a manual and IS helping
by letting him know what the relevant procedures/functions are. Once the user
knows THAT, nothing more is required as the manual and help system will deliver
with excellent examples.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 15:18:40
From Trevor Carlsen
To Nelson Vieira
Subject Question
NV> How is writeln able to accept any variable type...
NV> ex: writeln(string,integer,string,byte,boolean)
NV> ... Trying to make my own DV writeln.. that will write
NV> directly to the DV video address memory..
The writeln procedure is actually compiled as calls to as many specialised
procedures as is needed. Thus the necessary interpretation of what is required
is done at compile time and not at runtime as it would be with a "normal"
procedure.
What you need to do is use a TFDD (Text File Device Driver) to create a string
that you can then pass to your special routine. It is some time now since
I posted such a beast so is the unit that will help.
{$B-,D-,F-,I-,L-,N-,O-,R-,S-,V-}
unit filestr;
interface
uses dos;
function GetFstr(var f: text): string;
procedure OpenFStr(var f: text);
implementation
var
FStrBuff : string;
function GetFStr(var f: text): string;
begin
GetFStr := FStrBuff;
FStrBuff[0] := #0;
TextRec(f).BufPos := 0;
end; { GetFStr }
{$F+}
function FStrOpen(var f: TextRec):word;
{ This does nothing except return zero to indicate success }
begin
FStrOpen := 0;
end; { FStrOpen }
function FStrInOut(var f: TextRec):word;
begin
FStrBuff[0] := chr(F.BufPos);
FStrInOut := 0;
end; { FStrInOut }
{$F-}
procedure OpenFStr(var f: text);
begin
with TextRec(f) do begin
mode := fmClosed;
BufSize := Sizeof(buffer);
OpenFunc := @FStrOpen;
InOutFunc := @FStrInOut;
FlushFunc := @FStrInOut;
CloseFunc := @FStrOpen;
BufPos := 0;
BufEnd := 0;
BufPtr := @FStrBuff[1];
Name[0] := #0;
end; { with }
FStrBuff[0] := #0;
rewrite(f);
end; { AssignFStr }
end. { FileStr }
Now to use that unit all that is needed is for you to call the OpenFStr procedur
, that will open a TFDD. When you write to the TFDD the string can then be
returned by a call to GetFStr. If you want to make it even easier you can
write to the DV video whilst in the DD.
Study TFDDs closely. They have many uses and can save many hours of frustration
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 15:24:17
From Trevor Carlsen
To Primus
Subject Execute .Com Files In Pas
OV> swapvectors;
OV> exec('program.exe','/?');
OV> swapvectors;
P> No no no, it shall work like that boy, try this
P> SwapVectors;
P> Exec(GetEnv('COMSPEC'),' /C program.exe parameters');
P> SwapVectors;
The method you are recommending is actually the slower and less efficient
of the two. The method demonstrated by OV will work just fine PROVIDING program
exe is in the current directory. Your method loads another copy of the command
processor and that is unnecessary in this case.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 09:29:54
From Trevor Carlsen
To Peter Beeftink
Subject Heap maximum
PB> {$M stacksize, heapmin, heapmax}
PB> How can you determine (other than by trial and error) how
PB> much heap size a particular program uses, and therefor set
PB> the heapmax to a reasonable value. As the compiler sets it
PB> by default to it's maximum value I would like to bring this
PB> down.
As you - the program author - control what is on the heap and what is not,
it is up to you to arbitarily decide what are the best sizes to use. This
will involve educated guesses based on your knowledge of what your program
does. Unless you use the heap the best sizes are zero and zero!
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 15:25:17
From Trevor Carlsen
To Brian Stark
Subject Using the Port[] command...
BS> Did I miss something, or is the Port[] command
BS> undocumented?? I don't see anything about it in
BS> the online help in TP v5.5, or my books.
pp 221 in the manual. (Reference Guide) Sometimes my page numbers are different
so if 221 is not the page look under Port in the Index.
However it appears to have been overlooked in the on-line help. Incredible.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 10:32:49
From Trevor Carlsen
To Jim McNamee
Subject Turbo Pascal 7
JM> A flier from Waldensoftware arrived yesterday advertising Turbo Pascal
JM> The 25-words-or-less blurb describing this product said it
JM> was an MS DOS language bundled with Turbo Vision. Is TP7
JM> something new, is this a printer's typo, or is it just old
JM> wine in new bottles?
Interesting. Could be that big software distributors have been advised that
release of TP7 is imminent and they are updating their promos.
Could also be just a typo!
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 15:28:36
From Trevor Carlsen
To Peter Beeftink
Subject Writing directly to disk sectors.
TC> Look up truncate in the manual.
PB> Cute, if the manual showed it I wouldn't ask it. My manual
PB> is "Using Turbo Pascal" by Michael Yester.
When you purchase TP it comes with a manual (3 volumes actually). That was
what I was referring to.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 11:41:19
From Trevor Carlsen
To Rolf Thomassen
Subject Keyboard Buffer
GL> try the following:
GL> WHILE KeyPressed DO Readkey;
RT> And then you do the same mistake your self...
GL's method above is valid if TP6 is being used with extended syntax.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 11:44:29
From Trevor Carlsen
To Mike Melamed
Subject X:xxx/xx.x format
MM> Can some tell me how to use the above format? Is it a telephone
MM> number? A TEL-NET address? What is it???
MM> Example: 1:459/29.2
It is a FidoNet node number. The 1 is the zone -
1 = North America
2 = Europe
3 = Oceania
4 = South America
5 = Africa
6 = Asia
459 is the network, 29 is the node and if there is a decimal point number
it indicates that it is a point off a node.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 15:30:14
From Trevor Carlsen
To Chris Kaminski
Subject WHY I HATE TURBO PASCAL 6
CK> Well, if you are really that power hungry, try C or C++... It's better
CK> language if you need a whole lot of power. But if you want
CK> to stick with Pascal, I'll tell you that Borland makes the
CK> best Pascal ...
Chris, you appear to believe the common fallacy that C is the more powerful
language. Whilst there may be some isolated things that are easier to do
in C, the reverse is also true. Pascal is generally equal to or better than
C as far as speed goes and is usually better when exe size is the benchmark.
Obviously which compiler is being used is an important factor as some of the
highly optimising C compilers are quite good. They seem to still trail a
good optimising Pascal compiler though.
If you disagree with the above why not define something that you can do better
in C than in Pascal (Turbo or Turbo compatible).
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 16:30:11
From Trevor Carlsen
To Tony Nugent
Subject Off line readers
TN> I'm using Offline, just upgraded to v1.37 which is an improvement
TN> over v1.36 which would trunicate messages and replies
TN> variously at 100, 150 and 200 lines. The upgrade seems to
TN> spit out anything over 300 lines.
I tried many, many different readers. IMHO, none were any good.
TN> The question is, what do you regard as a *decent* mail reader?
TC-ED :-)
TN> You use TC-ED v2.01 - your own reader? Is it any good and is it
TN> generally available?
Yes my own - but not available at this stage. If I ever get the time to finish
it and polish it... maybe.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 16:47:38
From Trevor Carlsen
To Alan Graff
Subject Reading C++ records
AG> Byte 1: Char;
AG> Bytes 2 - 124: String;
AG> Bytes 125-128: Longint;
AG> Bytes 129-132: Longint;
AG> The problem I am having is that the string from byte 2 to
AG> 124 has no index to tell how long the string is...thus
AG> giving a bad result when I try to blockread the record.
AG> Does anyone know how I can blockread this record without
AG> declaring the string as 123 separate characters?
The string will be an ASCIIZ string. That is, it is nul terminated. The
length can be determined by where the nul character is.
type
YourRec = record
FirstByte : byte;
TheStr : array[1..123] of char;
Long1,
Long2 : longint;
end
var
f : file of YourRec;
r : YourRec;
s : string[123];
function Asc2Str(var s; max: byte): string;
{ Converts an ASCIIZ string to a Turbo Pascal string }
{ with a maximum length of max. }
var starray : array[1..255] of char absolute s;
len : integer;
begin
len := pos(#0,starray)-1; { Get the length }
if (len > max) or (len < 0) then { length exceeds maximum }
len := max; { so set to maximum }
Asc2Str := starray;
Asc2Str[0] := chr(len); { Set length }
end; { Asc2Str }
read(f,r);
s := Asc2Str(r.TheStr,123);
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 17:04:40
From Trevor Carlsen
To Rich Veraa
Subject Your problem
TC> I cannot locate your exact problem but
TC> it appears to be an out-of-range error
TC> on the variable index. Check that out carefully.
RV> BINGO! A procedure using a variable indexed by index gets called
RV> outside the for loop that increments index...
RV> I looked right past that a hundred times.
ERR_FUNC to the rescue once more!
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 17:14:34
From Trevor Carlsen
To Kevin O'Donnell
Subject Prime Number Unit
KO> I am trying to write a unit which will contain an unlimited number
KO> of prime numbers. I want to declare the prime numbers as an ordinal
KO> type. I already have approx. 8000 prime numbers (from 1 to 89000) but
KO> am having trouble declaring the type.
The best way is to create a bit map that you can store in a file and load
into an array on the heap. That will allow you to instantly look up any number
between 0..524168 and determine if it is prime. Here is an example of the
type of thing I mean. With a little modification it should be perfect for
what you want.
const
max = 65519;
type
flagArray = array[0..max div 8] of byte;
fptr = ^flagarray;
var
flags : fptr;
x,j : word;
total : word;
f : file of word;
function BitIsSet(var x; numb : longint): boolean;
{ Tests the numb bit in the bitmap array }
var m: flagArray absolute x;
begin
BitIsSet := odd(m[numb shr 3] shr (numb and 7));
end;
procedure SetBit(var x; numb: word);
{ Sets the numb bit in the bitmap array }
var m: flagArray absolute x;
begin
m[numb shr 3] := m[numb shr 3] or (1 shl (numb and 7))
end;
procedure ResetBit(var x; numb : longint);
{ Resets the numb bit in the bitmap array }
var m: flagArray absolute x;
begin
m[numb shr 3] := m[numb shr 3] and not(1 shl (numb and 7));
end;
begin
assign(f,'e:\primes.dat');
rewrite(f);
total := 0;
new(flags);
FillChar(flags^,sizeof(flags^),$ff);
for x := 2 to (max shr 1) do
if BitIsSet(flags^,x) then
for j := x to (max div x) do
ResetBit(flags^,x * j);
for x := 1 to max do
if BitIsSet(flags^,x) then
write(f,x);
close(f);
end.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/06/27 15:01:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 07:40:28
From Dj Murdoch
To Russ Bellew
Subject Re: Tp 6 ide
RB> How can I make TP 6's IDE, by default, start all text
RB> searches and search and replaces (^QA) at the current
RB> cursor position (rather than at the top of the .PAS file)???
I don't think there's any way to do that. Due to a bug, your preferences
always revert to the (dumb) defaults when it starts up.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss v1.00b on 92/06/27 20:59:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 06-27-92 07:42:55
From Dj Murdoch
To John Giesbrecht
Subject Re: TP 5.0 Heap Error function
JG> function heapfunc(size : word) : integer; far;
I know you know this, but the original poster might not: In TP 5.0, the "far;"
would be replaced by the compiler directive {$F+} before the function:
{$f+}
function heapfunc(size : word) : integer; far;
If other functions followed, it's generally a good idea to turn off the far
calls after the end.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss v1.00b on 92/06/27 20:59:20